package net.pushtime.dicmonitor;

import net.pushtime.dicmonitor.config.ApplicationProperties;
import net.pushtime.dicmonitor.service.DictionaryMonitorService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableConfigurationProperties({ApplicationProperties.class})
public class DicMonitorApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(DicMonitorApplication.class, args);
		DictionaryMonitorService monitorService = context.getBean(DictionaryMonitorService.class);
		// 初始化目录监控程序
		monitorService.init();
		// 开始监控
		monitorService.startMonitor();
		// 结束监控程序
		// monitorService.close();
	}
}
